package MyQueue;

import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;

public class Test {

    public static void main(String[] args) {
        Deque<Integer> queue=new LinkedList<>();//双端队列的链式实现
        queue.offerFirst(1);//头插
        queue.pollFirst();//头删

        Deque<Integer> queue2=new ArrayDeque<>();//双端队列的线性实现

        Deque<Integer> stack=new ArrayDeque<>();
        stack.push(1);
    }

    public static void main1(String[] args) {
        MyQueue queue=new MyQueue();
        queue.offer(1);//尾插法
        queue.offer(2);
        queue.offer(3);
        queue.offer(4);

        System.out.println(queue.poll());//1//头删
        System.out.println(queue.peek());//2
        System.out.println(queue.peek());//3
        System.out.println(queue.isEmpty());
    }
}
